import http from '../request';
const apibase = '/api/SemiMGoodsDistributeDetail';

/** 查询数据 */
var getDetailData = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetSemiMGoodsDistributeDetailList`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
//查询投料数据
var getSemiMGoodsDistributePlanList = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetSemiMGoodsDistributePlanList`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 查询精华液分配信息 */
var getSemiMGoodsRecordRequest = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetSemiMGoodsRecordRequest`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 查询精华液分配信息 */
var getSemiMGoodsRecordsByDistribute = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetSemiMGoodsRecordsByDistribute`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 查询精华液已经分配信息 */
var getSemiMGoodsDistributeDetailListByAlready = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetSemiMGoodsDistributeDetailListByAlready`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 查询投料单 */
var getPreparationPlanData = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetPreparationPlanList`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

/** 添加精华液分配信息 */
var insSemiMGoodsDistributeDetail = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/InsSemiMGoodsDistributeDetail`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

/** 修改精华液分配信息 */
var updSemiMGoodsDistributeDetail = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/UpdSemiMGoodsDistributeDetail`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 修改投料单分配信息 */
var updSemiMGoodsPlanRelation = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/UpdSemiMGoodsPlanRelation`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 删除精华液分配信息 */
var delSemiMGoodsDistributeDetail = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/DelSemiMGoodsDistributeDetail`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

/** 批量删除精华液分配明细信息 */
var delSemiMGoodsDistributeDetailList = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/DelSemiMGoodsDistributeDetailList`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 批量删除投料单分配明细信息 */
var delSemiMGoodsPlanRelationList = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/DelSemiMGoodsPlanRelationList`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 查询精华液已经分配信息（条码） */
var getSemiMGoodsRecordToID = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetSemiMGoodsRecordToID`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

/** 添加投料单分配信息 */
var insSemiMGoodsPlanRelation = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/InsSemiMGoodsPlanRelation`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

export {
  getDetailData,
  getSemiMGoodsRecordRequest,
  getSemiMGoodsRecordsByDistribute,
  getSemiMGoodsDistributeDetailListByAlready,
  getPreparationPlanData,
  insSemiMGoodsDistributeDetail,
  updSemiMGoodsDistributeDetail,
  delSemiMGoodsDistributeDetail,
  delSemiMGoodsDistributeDetailList,
  getSemiMGoodsRecordToID,
  getSemiMGoodsDistributePlanList,
  insSemiMGoodsPlanRelation,
  updSemiMGoodsPlanRelation,
  delSemiMGoodsPlanRelationList,
};
